<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.spoto.oa.model.Sales" isELIgnored="false"%>
<%@ page import="com.spoto.oa.util.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>销售报表欢迎界面</title>
		<link href="style/v1/common/welcome.css" rel="stylesheet">
		<script type="text/javascript" src="js/lib/jquery-1.4.2.js"></script>
		<script type="text/javascript" src="js/lib/jquery.validate.js"></script>
		<script type="text/javascript" src="js/lib/cal.js"></script>
		<link href="style/calendar.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/sales/charts.js"></script>
	</head>

	<body>
		<div id="welcome">
			<div class="label">
				<div class="img">
				</div>
				<h2>
					销售报表
				</h2>
			</div>
			<div class="ope">
				<form class="form" action="ChartServlet" method="post"
					onsubmit="return subcheck()">
					<input type="hidden" name="styleValue" id="styleValue"
						value="${styleType}" />
					<input type="hidden" name="searchTypeValue" id="searchTypeValue"
						value="${searchTypeValue}" />
					<input type="hidden" name="dateBeginValue" id="dateBeginValue"
						value="${dateBeginValue}" />
					<input type="hidden" name="dateEndValue" id="dateEndValue"
						value="${dateBeginValue}" />
					<select name="style" id="style" onchange="submit()">
						<option value="bar">
							柱状图
						</option>
						<option value="bar3D">
							柱状图3D
						</option>
						<option value="line">
							折线图
						</option>
						<option value="line3D">
							折线图3D
						</option>
					</select>
					<select id="searchType" onchange="typeChange()" name="searchType">
						<option value="year" selected="selected">
							年
						</option>
						<option value="day">
							日
						</option>
						<option value="month">
							月
						</option>
						<option value="season">
							季度
						</option>
					</select>
					<select id="month">
						<%
							for (int i = 1; i <= 12; i++) {
						%>
						<option value=<%=i%>>
							<%=i%>
						</option>
						<%
							}
						%>
					</select>
					<select id="season">
						<%
							for (int i = 1; i <= 4; i++) {
						%>
						<option value=<%=i%>>
							第<%=i%>季度(<%=i * 3 - 2%>月~<%=i * 3%>月)
						</option>
						<%
							}
						%>
					</select>
					<input type="text" name="dateBegin" class="date" id="dateBegin" />
					<input type="text" name="dateEnd" class="date" id="dateEnd" />
					<input type="submit" value="查询" class="search">
				</form>
			</div>
			<%
				System.out.println(request.getParameter("chartFlag"));
				if (request.getParameter("chartFlag") == null
						|| !(request.getParameter("chartFlag").equals("0"))) {
			%>
			<div id="list">
				<jsp:include page="charts.jsp?graphURL=${graphURL}"></jsp:include>
			</div>
			<%
				}
			%>
		</div>
	</body>
</html>
